#ifndef LOGICL_POOL_H
#define LOGICL_POOL_H

#include "SingleClass.h"
#include "global.h"
#include <mutex>
#include <queue>
#include <condition_variable>
#include <vector>
#include <thread>
#include <atomic>


class logical_pool:public SingleClass<logical_pool>{

public:
    void post_task(struct full_msg *);
    ~logical_pool();
private:
    friend class SingleClass<logical_pool>;
    logical_pool(); //完成线程的初始化
    std::queue<struct full_msg *>task_queue;
    std::vector<std::thread>thread_vector;
    std::atomic<bool> is_stop;
    std::condition_variable cond_var;
    std::mutex mtx;
    u_short pool_size;



};


#endif